import { DBObject } from "./DBObject";
import User from "./User";
export enum MessageType {
  TEXT = 1,
  AUDIO = 2,
  FILE = 3
}
export class Message extends DBObject {
  // message text
  public message: string = "";
  // message type
  public type: MessageType = MessageType.TEXT;
  // Who sent
  public sendUser: User | null = null;
  // sent time(timestamp in ms)
  public sendTime: number | null = 0;
  // received time(timestamp in ms)
  public receviceTime: number | null = 0;
  // is read or not
  // if message is a audio, clicked set to true;
  // if message is a text, showd set to true;
  // if message is a file, clicked set to true;
  public readed: boolean = false;
  // audio file context
  public audio: any = null;
  // audio file url
  public audioUrl: string = "";
  // file context
  public file: File = null;
  // file url
  public fileUrl: string = "";
  // how many likes
  public likeCount: number = 0;
}
